package com.lzy.spring.proxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class ManHandler implements InvocationHandler {

    private Man man;

    public ManHandler(Man man) {
        this.man = man;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Exception {
        before();
        method.invoke(man, null);
        after();
        return null;
    }

    public void before() {
        System.out.println("还没有找到。。。");
    }

    public void after() {
        System.out.println("已经找到了。。。");
    }
}
